﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class service_dqrcx : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            if (Session["username"] != null && Session["userpwd"] != null)
            {
                string userName = Session["username"].ToString();
                string userpwd = Session["userpwd"].ToString();
                this.hidName.Value = userName;
                this.lblUser.Text = userName;
                lblResult.Text = Dqrcx(userName, userpwd);
                lblDpxf.Text = DpxfDqrcx(userName, userpwd);
            }
            else
            {
                Response.Redirect("service_self.aspx");
            }
        }
    }
    /// <summary>
    /// 单独查询盯盘先锋的到期日
    /// </summary>
    /// <param name="uname">用户名</param>
    /// <param name="upwd">密码</param>
    /// <returns></returns>
    protected string DpxfDqrcx(string uname, string upwd)
    {
        try
        {
            emoneybussiness.emoneybusiness service = new emoneybussiness.emoneybusiness();
            string result = service.SearchEMGet_EndDate_SD(uname, upwd);
            return result;
        }
        catch (Exception)
        {

            return "服务器忙，请重试";
        }
    }
    /// <summary>
    /// 到期日查询
    /// </summary>
    /// <param name="uname">用户名</param>
    /// <param name="upwd">密码</param>
    /// <returns></returns>
    protected string Dqrcx(string uname, string upwd)
    {
        try
        {
            emoneybussiness.emoneybusiness service = new emoneybussiness.emoneybusiness();
            string result = service.EMGet_EndDate_New(uname, upwd, 1);
            if (result.IndexOf("沪市") > -1 && result.IndexOf("深市") == -1)
            {
                result += "<br/><br/>深市L2行情尚未付费开通，咨询400-670-8688";
            }
            if (result.IndexOf("深市") > -1 && result.IndexOf("沪市") == -1)
            {
                result += "<br/><br/>沪市L2行情尚未付费开通，咨询400-670-8688";
            }
            result = result.Replace("\r\n", "<br/>");
            return result;
        }
        catch (Exception ex)
        {
            return "服务器忙，请重试";
        }
    }
}